package net.csdn.business.kanban.common.constant;

/**
 * @author likun
 * @date 2022/6/6 18:34
 */
public class CommonConstants {
    public static final String TRUE = "true";

    /**
     * 命名空间验证正则表达式
     */
    public static final String NAME_SPACE_REGEX = "^(?!-)[a-zA-Z0-9_\\-]+(?<!\\.|\\.git)$";

    public static final String TRACE_ID = "traceId";

    public static final String TRACE_IP = "TRACE_IP";

    public static final String FIELD_TRACE_ID = "traceid";
    public static final String FIELD_EAGLEEYE_TRACEID = "eagleeye-traceid";

    public static final String FIELD_UID = "uid";
    public static final String FIELD_ASSIGN_USER = "assignUser";
    public static final String FIELD_PROJECT_ID = "projectId";

    public static final String X_AUTH_TOKEN = "x-auth-token";
    public static final String X_UID = "x-uid";
    public static final String X_USERNAME = "x-username";
    public static final String X_IAM_ID = "x-iam-id";
    public static final String X_CODE_ART_ID = "x-code-arts-id";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "r_s:";

    public static final String TEXT_UNKNOWN = "unknown";

    public static String COMMA = ",";
    public static String COLON = ":";
    public static String SLASH = "/";
    public static String POUND = "#";
    public static String UNDERLINE = "_";
    public static String BLACK = "";
    public static String UTF_8 = "utf-8";
    public static String UTF8 = "UTF8";
    public static String MD5 = "MD5";

    public static final int INT_ZERO = 0;
    public static final int INT_ONE = 1;
    public static final int INT_NEGATIVE_ONE = -1;
    public static final int INT_EIGHT = 8;
    public static final int INT_TEN = 10;
    public static final int INT_TWENTY = 20;
    public static final int INT_THIRTY = 30;
    public static final int ONE_HUNDRED = 100;

    public static final long LONG_ZERO = 0L;

    public static final double DOUBLE_ZERO = 0d;
    public static final double DOUBLE_ONE = 1.0;

    public static final String HEADER_TOKEN_EXTERNAL_NO_FILL = "External-no-fill";
    public static final String HEADER_TOKEN_EXTERNAL_AK = "External-Ak";
    public static final String HEADER_TOKEN_EXTERNAL_TOKEN = "External-token";

    public static final String UPLOAD_PATH = "uploads/";
    public static final String UPLOAD_PATH_USER = "uploads/user/";

    public static final String SETTINGS = "settings";
    public static final String SUFFIX_GIT = ".git";
    public static final String PREFIX_GIT = "git@";
    public static final String PREFIX_HTTPS = "https://";

    public static final String CONTENT_TYPE_EXCEL = "application/vnd.ms-excel;charset=utf-8";

    public static final int ASYNC_DELAY_MS = 5000;

    /**
     * 项目搜索默认排序
     */
    public static final String PROJECT_DEFAULT_ORDER = "last_activity_at";
    public static final String PROJECT_ORDER_STAR_COUNT = "star_count";

    public static final int NOTIFY_CONTENT_SIZE = 100;
    /**
     * 邮箱推送相关:每个模板单一的code
     */
    public static final String joinRepOrOrgInvitation = "joinRepOrOrgInvitation";
    public static final String invitationSuccess = "invitationSuccess";
    public static final String invitationFail = "invitationFail";
    public static final String abnormalLogin = "abnormalLogin";
    public static final String userDestroy = "userDestroy";
    public static final String userRegisterSuccess = "userRegisterSuccess";
    public static final String sshKeyAddition = "sshKeyAddition";
    public static final String issueAdd = "issueAdd";
    public static final String issueCloseWithComment = "issueCloseWithComment";
    public static final String issueCloseNoneComment = "issueCloseNoneComment";
    public static final String issueMention = "issueMention";
    public static final String issueNewComment = "issueNewComment";
    public static final String issueMove = "issueMove";
    public static final String issuePrincipalChange = "issuePrincipalChange";
    public static final String issuePrincipalChangeToNobody = "issuePrincipalChangeToNobody";
    public static final String issueStatusChange = "issueStatusChange";
    public static final String deleteOrg = "deleteOrg";
    public static final String aliTemplate = "aliTemplate";
    public static final String auditCommentNotPass = "auditCommentNotPass";
    public static final String auditNotPass = "auditNotPass";
    public static final String auditReportNotPass = "auditReportNotPass";
    public static final String auditReportPassForReporter = "auditReportPassForReporter";
    public static final String auditReportPassForOwner = "auditReportPassForOwner";
    public static final String issuePrincipalChangeToFirstPerson = "issuePrincipalChangeToFirstPerson";
    public static final String ISSUE_COMMENT_AT = "issueCommentAt";
    /**
     * 组织关联相关模板
     */
    public static final String ORG_RELATION_INVITATION = "OrgReleationInvitation";
    public static final String ORG_RELATION_INVITATION_PASS = "OrgReleationInvitationPass";
    public static final String ORG_RELATION_INVITATION_REJECT = "OrgReleationInvitationReject";
    public static final String SUB_ORG_QUIT_PARENT_ORG = "SubOrgQuitParentOrg";


    /**
     * CLA协议检查
     */
    public static final String CHECK_DESC_CLA_NOT_FOUND = "未关联到CLA协议";
    public static final String CHECK_DESC_CLA_STATUS_OFF = "关联的CLA协议处于未启用状态";
    // public static final String CHECK_DESC_CLA_MR_CHECK_OFF = "关联的CLA协议未开启MR检查";
    // public static final String CHECK_DESC_CLA_ORG_CHECK_OFF = "组织内成员且未启用组织成员CLA检查";
    public static final String CHECK_DESC_CLA_SIGN_VALID = "已签署协议,且生效中";
    public static final String CHECK_DESC_CLA_SIGN_INVALID = "未签署协议或已过期";

    public static final String CLA_UN_SIGN_TEMPLATE = "<a href='#{[userProfile]}'>@#{[username]}</a>，欢迎向 <a href='#{[repoUrl]}'>#{[repo]}</a> 代码库贡献代码，我们目前尚未查找到您账号（邮箱：<code>#{[mail]}</code>）签署的贡献者协议文件（CLA），请在代码被合入前完成 CLA 协议的签署。\n\n" +
            "<blockquote><a href='#{[signAddr]}'>点击签署 #{[claName]}.（#{[claVersion]}）</a></blockquote>";

    public static final String CLA_SIGN_TEMPLATE = "<a href='#{[userProfile]}'>@#{[username]}</a>，您的 CLA 已经签署完成并生效，点击查看<a href='#{[signAddr]}'>已签署 CLA 协议</a>。";

    /**
     * 待签署地址（准备签署地址）
     */
    public static final String CLA_SIGN_ADDR = "/cla/agreement/%s/sign";

    /**
     * 已经签署过(个人设置已签署）
     */
    public static final String CLA_SIGNED_ADDR = "/-/profile/clas";

    public static final String PULL_REQUEST_ADDR = "/%s/change/%d";

    /**
     * 日期格式化配置
     */
    public static final String DEFAULT_PATTERN = "yyyy-MM-dd'T'HH:mm:ssXXX";
    public static final String DEFAULT_TIMEZONE = "GMT+8";

    /**默认自定义字段名称*/
    public static final String FIELD_DEFAULT_NAME = "Status";

}